<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../css/sys.css" type="text/css" rel="stylesheet" />
<script src="../js/jquery-3.2.1.js"></script>
    <script>
        urlinfo = window.location.href; //获取当前页面的url
        len = urlinfo.length;//获取url的长度
        offset = urlinfo.indexOf("?");//设置参数字符串开始的位置
        newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
        newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割
        newsid = newsids[1];//得到参数值
        newsname = newsids[0];//得到参数名字

        function addFollow() {
            $.ajax({
                url:"addfollow",
                type:"post",
                data:{
                    content:$("#content").val(),
                    staffid:${sid},
                    referid:newsid
                },
                success:function (result) {
                    alert(result.message);
                    if (result.message == "添加成功"){
                        window.location.href='showRefer?id='+newsid;
                    }
                }
            })
        }


    </script>
</head>

<body class="emp_body">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr>
    <td class="topg"></td>
  </tr>
</table>

<table border="0" cellspacing="0" cellpadding="0"  class="wukuang"width="100%">
  <tr>
    <td width="1%"><img src="../images/tleft.gif"/></td>
    <td width="44%" align="left">[添加跟踪]</td>

    <td width="52%"align="right">
       <a onclick="addFollow()"><img src="../images/button/save.gif" /></a>
       <a href="javascript:history.back(-1);"><img src="../images/button/tuihui.gif" /></a>
    </td>
    <td width="3%" align="right"><img src="../images/tright.gif"/></td>
  </tr>
</table>

<form action="../pages/refer/showRefer.jsp" method="post">
	<%--当前咨询 --%>
	<table width="88%" border="0" class="emp_table" style="width:80%;">
	  <tr>
	    <td width="10%">跟踪信息：</td>
	    <td width="20%">
	    	<textarea rows="5" cols="40" name="content" id="content"></textarea>
	    </td>
	    <td width="70%"></td>
	  </tr>
	</table>
</form>
</body>
</html>